1 % Generator: GNU source-highlight, by Lorenzo Bettini, http://www.gnu.org/software/src-highlite
3 {\ttfamily \raggedright {
5 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$iostream$>$
}} \\
6 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$cassert$>$
}} \\
7 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$stdio.h$>$
}} \\
8 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$assert.h$>$
}} \\
9 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$wchar.h$>$
}} \\
10 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$wctype.h$>$
}} \\
11 \mbox{}\textbf{\textcolor{RoyalBlue
}{\#include
}}\
\texttt{\textcolor{Red
}{$<$locale.h$>$
}} \\
13 \mbox{}\textbf{\textcolor{Blue
}{using
}}\
\textbf{\textcolor{Blue
}{namespace
}}\ std
\textcolor{BrickRed
}{;
} \\
15 \mbox{}\textcolor{ForestGreen
}{int
}\
\textbf{\textcolor{Black
}{main
}}\textcolor{BrickRed
}{()
}\textcolor{Red
}{\
{} \\
16 \mbox{}\ \
\textbf{\textcolor{Black
}{assert
}}\textcolor{BrickRed
}{(
}\textbf{\textcolor{Black
}{setlocale
}}\textcolor{BrickRed
}{(
}LC$
\_$ALL
\textcolor{BrickRed
}{,
}\
\texttt{\textcolor{Red
}{"
{}en$
\_$US.UTF-
8"
{}}}\textcolor{BrickRed
}{)
}\
\textcolor{BrickRed
}{!=
}\ NULL
\textcolor{BrickRed
}{);
} \\
17 \mbox{}\ \
\textcolor{ForestGreen
}{wchar$
\_$t
}\ c
\textcolor{BrickRed
}{;
} \\
19 \mbox{}\ \ wstring\ s
\textcolor{BrickRed
}{;
} \\
20 \mbox{}\ \
\textbf{\textcolor{Blue
}{while
}}\
\textcolor{BrickRed
}{(
}\textbf{\textcolor{Black
}{getline
}}\textcolor{BrickRed
}{(
}wcin
\textcolor{BrickRed
}{,
}\ s
\textcolor{BrickRed
}{))
}\textcolor{Red
}{\
{} \\
21 \mbox{}\ \ \ \ wcout\
\textcolor{BrickRed
}{$<$$<$
}\ L
\texttt{\textcolor{Red
}{"
{}LeĆ\ :\ "
{}}}\
\textcolor{BrickRed
}{$<$$<$
}\ s\
\textcolor{BrickRed
}{$<$$<$
}\ endl
\textcolor{BrickRed
}{;
} \\
22 \mbox{}\ \ \ \
\textbf{\textcolor{Blue
}{for
}}\
\textcolor{BrickRed
}{(
}\textcolor{ForestGreen
}{int
}\ i
\textcolor{BrickRed
}{=
}\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
}\ i
\textcolor{BrickRed
}{$<$
}s
\textcolor{BrickRed
}{.
}\textbf{\textcolor{Black
}{size
}}\textcolor{BrickRed
}{();
}\
\textcolor{BrickRed
}{++
}i
\textcolor{BrickRed
}{)
}\textcolor{Red
}{\
{} \\
23 \mbox{}\ \ \ \ \ \ c\
\textcolor{BrickRed
}{=
}\ s
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{];
} \\
24 \mbox{}\ \ \ \ \ \
\textbf{\textcolor{Black
}{wprintf
}}\textcolor{BrickRed
}{(
}L
\texttt{\textcolor{Red
}{"
{}\%lc\ \%lc
}}\texttt{\textcolor{CarnationPink
}{\textbackslash{}n
}}\texttt{\textcolor{Red
}{"
{}}}\textcolor{BrickRed
}{,
}\
\textbf{\textcolor{Black
}{towlower
}}\textcolor{BrickRed
}{(
}s
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{]),
}\
\textbf{\textcolor{Black
}{towupper
}}\textcolor{BrickRed
}{(
}s
\textcolor{BrickRed
}{[}i
\textcolor{BrickRed
}{]));
} \\
25 \mbox{}\ \ \ \
\textcolor{Red
}{\
}} \\
26 \mbox{}\ \
\textcolor{Red
}{\
}} \\
28 \mbox{}\ \
\textbf{\textcolor{Blue
}{return
}}\
\textcolor{Purple
}{0}\textcolor{BrickRed
}{;
} \\
29 \mbox{}\textcolor{Red
}{\
}} \\
33 } \normalfont\normalsize